hysop.operator.base.external_force module¶
- class hysop.operator.base.external_force.ExternalForce(name, dim, Fext, **kwds)[source]¶
Bases:
NamedObjectI
Interface to implement a custom external force.
Create an abstract named object that contains a symbolic value. name : string
A name for the field.
- pretty_name: string, optional.
A pretty name used for display whenever possible. Defaults to name.
- kwds: dict
Keywords arguments for base class.
- property Fext¶
- property diffusion¶
- property dim¶
- class hysop.operator.base.external_force.SpectralExternalForceOperatorBase(vorticity, Fext, dt, variables, Fmin=None, Fmax=None, Finf=None, implementation=None, **kwds)[source]¶
Bases:
SpectralOperatorBase
Compute the curl of a symbolic expression and perfom Euler time integration.
Create an operator that computes the curl of a given input force field Fext.
- Only the following configurations are supported:
dim nb_components | dim nb_components
vorticity: 2 1 | 3 3
- What is computed:
force = curl(Fext) by using a spectral backend Fmin = min(force) Fmax = max(force) Finf = max(abs(Fmin), abs(Fmax)) W += dt*force
where Fext is computed from user given ExternalForce.
- Parameters:
vorticity (hysop.field.continuous_field.Field) – Continuous field as input ScalarField or VectorField. All contained field have to live on the same domain.
Fext (hysop.operator.external_force.ExternalForce) – Expression of the external force.
F... (TensorParameter or boolean, optional) – TensorParameters should match the shape of tmp (see Notes). If set to True, the TensorParameter will be generated automatically.
variables (dict) – dictionary of fields as keys and topologies as values.
kwds (dict, optional) – Extra parameters passed towards base class (MultiSpaceDerivatives).
Notes
- If dim == 2, it is expected that:
vorticity has only one component Fext has 2 components
- Else if dim == 3:
vorticity has 3 components Fext has 3 components
- apply(**kwds)¶